package Spring;

import org.springframework.beans.factory.FactoryBean;

/**
 * @Auther: Administrator
 * @Date: 2019/8/9/009 19 56
 * @Description:
 */
public class PersonFactory implements FactoryBean<Person> {

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public Person getObject() throws Exception {
        return new Person(name);
    }

    @Override
    public Class<?> getObjectType() {
        return Person.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }
}
